<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QIap: qiap.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>qiap.h</h1>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef QIAP_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define QIAP_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;QObject&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;QList&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;QProgressDialog&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;iapclient.h&gt;</span>
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="keyword">class </span><a class="code" href="class_q_iap_private.html" title="In App Purchase Private wrapper implementation.">QIapPrivate</a>;
<a name="l00010"></a>00010 
<a name="l00018"></a><a class="code" href="class_q_iap.html">00018</a> <span class="keyword">class </span><a class="code" href="class_q_iap.html" title="In App Purchase wrapper implementation for local stored content.">QIap</a> : <span class="keyword">public</span> QObject
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020     Q_OBJECT
<a name="l00021"></a>00021     Q_DECLARE_PRIVATE(<a class="code" href="class_q_iap.html" title="In App Purchase wrapper implementation for local stored content.">QIap</a>)
<a name="l00022"></a>00022     Q_CLASSINFO(<span class="stringliteral">&quot;Author&quot;</span>, <span class="stringliteral">&quot;Sebastiano Galazzo&quot;</span>)
<a name="l00023"></a>00023     Q_CLASSINFO(<span class="stringliteral">&quot;Email&quot;</span>, <span class="stringliteral">&quot;sebastiano.galazzo@gmail.com&quot;</span>)
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="keyword">public</span>:
<a name="l00031"></a>00031     <span class="keyword">explicit</span> <a class="code" href="class_q_iap.html#abd5d1ef5174f381cf44bb79c1bac69d1" title="Constructor.">QIap</a>(QObject *parent = 0);
<a name="l00032"></a>00032 
<a name="l00036"></a>00036     <span class="keyword">virtual</span> <a class="code" href="class_q_iap.html#a2416f05f5aaf59e04e836ea5d71368ec" title="Destructor.">~QIap</a>();
<a name="l00037"></a>00037 
<a name="l00041"></a>00041     QList&lt;IAPClient::ProductDataHash&gt;&amp; <a class="code" href="class_q_iap.html#aec4845db432bac8b071486b286bcf57c" title="List of available IAP products on OVI Store.">availableProducts</a>();
<a name="l00042"></a>00042 
<a name="l00048"></a>00048     Q_INVOKABLE <span class="keywordtype">int</span>  <a class="code" href="class_q_iap.html#a6d5dfcf16e7aa58a3de1505075f88caf" title="Purchase a product by In-app ID.">purchaseProductByID</a>(QString productId, IAPClient::ForceRestorationFlag restoration=IAPClient::ForcedAutomaticRestoration);
<a name="l00049"></a>00049 
<a name="l00055"></a>00055     Q_INVOKABLE <span class="keywordtype">int</span>  <a class="code" href="class_q_iap.html#ada07f221851987bc10de4600150cb8fb" title="Purchase a product by product name ( info field ).">purchaseProductByName</a>(QString productName, IAPClient::ForceRestorationFlag restoration=IAPClient::ForcedAutomaticRestoration);
<a name="l00056"></a>00056 
<a name="l00062"></a>00062     Q_INVOKABLE <span class="keywordtype">bool</span> <a class="code" href="class_q_iap.html#aa7410a58c089c6dceb1671ea2db1833d">isPurchased</a>(QString fileName);
<a name="l00063"></a>00063 
<a name="l00071"></a>00071     Q_INVOKABLE QByteArray <a class="code" href="class_q_iap.html#a83948f56a2182dffcf034bd3e058a50f" title="Get DRM file content if the device can access the encrypted file.">getDRMFileContent</a>(QString productID,QString fileName);
<a name="l00072"></a>00072 
<a name="l00073"></a>00073 signals:
<a name="l00074"></a>00074     <span class="keywordtype">void</span> purchaseCompleted(QString status, QString productID);
<a name="l00075"></a>00075     <span class="keywordtype">void</span> purchaseFlowFinished( <span class="keywordtype">int</span> requestId );
<a name="l00076"></a>00076     <span class="keywordtype">void</span> getProductsCompleted();
<a name="l00077"></a>00077     <span class="keywordtype">void</span> restoreProductsCompleted();
<a name="l00078"></a>00078     <span class="keywordtype">void</span> itemRestored(QString  productID);
<a name="l00079"></a>00079 
<a name="l00080"></a>00080 <span class="keyword">public</span> slots:
<a name="l00084"></a>00084     <span class="keywordtype">void</span> <a class="code" href="class_q_iap.html#a62ebd3ceb50cea19b3bf8c19566dfd27" title="Get available IAP products on OVI Store.">getProducts</a>();
<a name="l00085"></a>00085 
<a name="l00089"></a>00089     <span class="keywordtype">void</span> <a class="code" href="class_q_iap.html#a0fd251c0a018960401bb5a925d1788e2" title="Retrieve previously purchased products.">restoreProducts</a>();
<a name="l00090"></a>00090 
<a name="l00094"></a>00094     <span class="keywordtype">void</span> <a class="code" href="class_q_iap.html#a5ceb77a331ae37bc83663913e24c15d2" title="Reset purchased products.">resetPurchases</a>();
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 <span class="keyword">protected</span>:
<a name="l00097"></a>00097 
<a name="l00101"></a><a class="code" href="class_q_iap.html#a451411c2540d1659a1e353ce065acd91">00101</a>     <a class="code" href="class_q_iap_private.html" title="In App Purchase Private wrapper implementation.">QIapPrivate</a>* <span class="keyword">const</span> <a class="code" href="class_q_iap.html#a451411c2540d1659a1e353ce065acd91">d_ptr</a>;
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 <span class="keyword">private</span>:
<a name="l00104"></a>00104     QProgressDialog* busyIndicator;
<a name="l00105"></a>00105 };
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 <span class="preprocessor">#endif // QIAP_H</span>
</pre></div></div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated on Thu Apr 26 2012 12:42:07 for QIap by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
